package com.plugin.core.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.time.LocalDateTime;

/**
 * @description SysMgrUser 系统用户信息表
 * @author mark
 * @Date 2025-07-23
 */

@ToString
@EqualsAndHashCode(callSuper=false)
@Getter
@Setter
@TableName("sys_mgr_user")
@Schema(name = "SysMgrUser", description = "系统用户信息表")
public class SysMgrUser {



    /**
     * 主键用户ID
     */
    @TableId(value = "user_id", type = IdType.AUTO)
    @Schema(description = "主键用户ID")
    private Long userId;


    /**
     * 角色ID
     */
    @TableField("role_id")
    @Schema(description = "角色ID")
    private Long roleId;

    /**
     * 部门ID
     */
    @TableField("dept_id")
    @Schema(description = "部门ID")
    private Long deptId;

    /**
     * 用户账号
     */
    @TableField("username")
    @Schema(description = "用户账号")
    private String username;

    /**
     * 用户昵称
     */
    @TableField("nickname")
    @Schema(description = "用户昵称")
    private String nickname;

    /**
     * 用户类型（00系统用户）
     */
    @TableField("user_type")
    @Schema(description = "用户类型")
    private Integer userType;

    /**
     * 用户邮箱
     */
    @TableField("email")
    @Schema(description = "用户邮箱")
    private String email;

    /**
     * 手机号码
     */
    @TableField("mobile_phone")
    @Schema(description = "手机号码")
    private String mobilePhone;

    /**
     * 用户性别（1男2女 0未知）
     */
    @TableField("sex")
    @Schema(description = "用户性别")
    private String sex;

    /**
     * 头像地址
     */
    @TableField("avatar")
    @Schema(description = "头像地址")
    private String avatar;

    /**
     * 密码
     */
    @TableField("password")
    @Schema(description = "密码")
    @JsonIgnore
    private String password;

    /**
     * 省
     */
    @TableField("province")
    @Schema(description = "省")
    private String province;

    /**
     * 市
     */
    @TableField("town")
    @Schema(description = "市")
    private String town;

    /**
     * 区
     */
    @TableField("area")
    @Schema(description = "区")
    private String area;

    /**
     * 帐号状态（0正常 1停用）
     */
    @TableField("account_status")
    @Schema(description = "帐号状态")
    private Integer accountStatus;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableField("del_flag")
    @Schema(description = "删除标志")
    private String delFlag;

    /**
     * 最后登录IP
     */
    @TableField("login_ip")
    @Schema(description = "最后登录IP")
    private String loginIp;

    /**
     * 最后登录时间
     */
    @TableField("login_date")
    @Schema(description = "最后登录时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime loginDate;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    @Schema(description = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonIgnore
    private LocalDateTime updateTime;

    /**
     * 备注
     */
    @TableField("remark")
    @Schema(description = "备注")
    private String remark;

}
